<template>
    <div class="movie_body">
    <loading v-if="isLoading"></loading>
    <scroller v-else>
      <ul>
        <li v-for="item in comingList" :key="item.id">
          <div class="pic_show"  @click="handleToDetail(item.id)">
            <img :src="item.img | setWH('128.180')">
          </div>
          <div class="info_list">
            <h2 @click="handleToDetail(item.id)">{{item.nm}} <img v-if="item.version" src="@/assets/img/3DImax.png" alt=""></h2>
            <p>
              <span class="person">{{item.wish}}</span> 人想看
            </p>
            <p>{{item.star}}</p>
            <p>{{item.rt}}</p>
          </div>
          <div class="btn_pre">预售</div>
        </li>
      </ul>
    </scroller>
  </div>

</template>

<script>
export default {
    name:'ComminSoon',
    data () {
      return {
        comingList: [],
        isLoading:true,
        prevCityId: -1
      }
    },
    methods: {
      handleToDetail (movieId) {
         this.$router.push('/movie/detail/2/' + movieId)
      }
    },
    activated () {
      var cityId = this.$store.state.city.id
      if(this.prevCityId === cityId) {
        return
      }
      this.isLoading = true;
      this.axios.get('/ajax/comingList?ci=10&token=&limit=10').then(res => {
        if(res.status && res.statusText) {
          res = res.data
          this.comingList = res.coming
          this.isLoading = false
          this.prevCityId = cityId
        }
      })
    }
}
</script>

<style scoped>
#content .movie_menu{ width: 100%; height: 45px; border-bottom:1px solid #e6e6e6; display: flex; justify-content:space-between; align-items:center; background:white; z-index:10;}
.movie_menu .city_name{ margin-left: 20px; height:100%; line-height: 45px;}
.movie_menu .city_name.active{ color: #ef4238; border-bottom: 2px #ef4238 solid;}
.movie_menu .hot_swtich{ display: flex; height:100%; line-height: 45px;}
.movie_menu .hot_item{ font-size: 15px; color:#666; width:80px; text-align:center; margin:0 12px; font-weight:700;}
.movie_menu .hot_item.active{ color: #ef4238; border-bottom: 2px #ef4238 solid;}
.movie_menu .search_entry{ margin-right:20px; height:100%; line-height: 45px;}
.movie_menu .search_entry.active{ color: #ef4238; border-bottom: 2px #ef4238 solid;}
.movie_menu .search_entry i{  font-size:24px; color:red;}

#content .movie_body{ flex:1; overflow:auto;}
.movie_body ul{ margin:0 12px; overflow: hidden;}
.movie_body ul li{ margin-top:12px; display: flex; align-items:center; border-bottom: 1px #e6e6e6 solid; padding-bottom: 10px;}
.movie_body .pic_show{ width:64px; height: 90px;}
.movie_body .pic_show img{ width:100%;}
.movie_body .info_list { margin-left: 10px; flex:1; position: relative;}
.movie_body .info_list h2{ font-size: 17px; line-height: 24px; width:150px; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;}
.movie_body .info_list p{ font-size: 13px; color:#666; line-height: 22px; width:200px; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;}
.movie_body .info_list .grade{ font-weight: 700; color: #faaf00; font-size: 15px;}
.movie_body .info_list img{ width:50px; position: absolute; right:10px; top: 5px;}
.movie_body .btn_mall , .movie_body .btn_pre{ width:47px; height:27px; line-height: 28px; text-align: center; background-color: #f03d37; color: #fff; border-radius: 4px; font-size: 12px; cursor: pointer;}
.movie_body .btn_pre{ background-color: #3c9fe6;}
</style>

</style>